/*
KuWo music unlock vip

QX1.0.0:
^https?:\/\/vip1\.kuwo\.cn\/(vip\/v2\/user\/vip|vip\/spi/mservice) url script-response-body https://raw.githubusercontent.com/NobyDa/Script/master/Surge/JS/Kuwo.js

Surge4.0:
http-response ^https?:\/\/vip1\.kuwo\.cn\/(vip\/v2\/user\/vip|vip\/spi/mservice) requires-body=1,max-size=0,script-path=https://raw.githubusercontent.com/NobyDa/Script/master/Surge/JS/Kuwo.js
http-request ^https?:\/\/musicpay\.kuwo.cn\/music\.pay\?uid=\d+ script-path=https://raw.githubusercontent.com/NobyDa/Script/master/Surge/JS/KuWoMusicDownload.js

MITM = vip1.kuwo.cn
*/

var body = $response.body;
var url = $request.url;
var obj = JSON.parse(body);

const members = '/members/details'

if (url.indexOf(members) != -1) {
    obj["code"] = "1";
    obj["msg"] = "";
    obj["data"] = {
        "1": {
            "memberType": 1,
            "memberClass": 2,
            "expireTime": 1616169599999,
            "hasBeenMember": true,
            "memberStatus": 2,
            "createdTime": 1615893002895,
            "member": true
        }
    };
    body = JSON.stringify(obj);
    console.log(`粉笔aaaaa${obj}`)
}
console.log(`粉笔 url ${url}`)
console.log(`粉笔 index ${url.indexOf(members)}`)
console.log(`粉笔bbbbb${body}`)
$done({ body });